﻿using MediatR;
using T_settlement.Domain;
using T_settlement.Infrastructure.Interfacec;
using T_settlement.Read.API.Application.Command.PaymentCommand;

namespace T_settlement.Read.API.Application.CommandHandlers.PaymentCommandHandlers
{
    public class FanPaymentCommandHandlers:IRequestHandler<FanPaymentCommnad,Payment>
    {
        private readonly IPaymentRepository paymentRepository;

        public FanPaymentCommandHandlers(IPaymentRepository paymentRepository)
        {
            this.paymentRepository = paymentRepository;
        }

        public async Task<Payment> Handle(FanPaymentCommnad request, CancellationToken cancellationToken)
        {
            var lits = await paymentRepository.GetModelAsync(request.PaymentId);
            return lits;
        }
    }
}
 